package com.xiaokai.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageInfo;
import com.xiaokai.entity.Student;
import com.xiaokai.service.StudentService;

@Controller
public class StudentController {
	
		@Autowired
		private StudentService service;
		
		@RequestMapping("list")
		public String list(Model m,@RequestParam(defaultValue="1")Integer pageNum,@RequestParam(defaultValue="2")Integer pageSize){
			
			PageInfo<Student> info = service.list(pageNum, pageSize);
			
			m.addAttribute("info", info);
			return "list";
		}
}
